import { defineComponent, ref, reactive, toRefs } from 'vue'
import Demo2 from "@/components/Demo2"; // @ is an alias to /src
interface ListType {
  title: string,
  render:Function
}
interface dataObject {
  list:Array<ListType>,
  obj:ListType,
  title:string
}
export default defineComponent({
  name: 'demo',
  components:{
    Demo2:defineComponent
  },
  props: {
    indata: String,
  },
  setup(props) {
    let list:Array<ListType>;
     list = [{
      title:'1111',
      render:(x:ListType)=>{
        return <span>{x.title}</span>
      }
    },{
      title:'22222',
      render:(x:ListType)=>{
        return <span>{x.title}</span>
      }
    }];
    const click = () => {
      alert('helloword')
    }
    let { indata } = props;
          console.log(indata);
    const dataObjectaa = {
      list:list,
      obj:{
        title:'2222',
        render:(x:ListType)=>{
          return <span>{x.title}</span>
        }
      },
      title:'2222'
    }
    return () => (
      <div >  jsx测试
         <Demo2 dataObject={dataObjectaa} list={list}  title="11111" />
        <el-button onClick={click} type="primary"> Click to download PDF {indata} </el-button>
      </div>
    )
  }

})
